import api from '../../api/site'

// state
const state = {
  siteInfo: {}
}

// mutations
const mutations = {
  getSiteInfo(state, item) {
    state.siteInfo = item
  }
}

// actions
const actions = {
  // 获取站点基本信息
  async getSiteInfo(ctx) {
    const { data } = await api.getSiteInfo()
    ctx.commit('getSiteInfo', data[0])
    return data[0]
  }
}

// getters
const getters = {}

export default {
  state,
  mutations,
  actions,
  getters
}
